# -*- coding: utf-8 -*-
# Author: xiantingDeng
# Email: dengxianting@shxgroup.net
# Time: 21:35

from common.element.element import Element
from common.utils.config import piece_together_element


class ExcesSiveBiz():
    def __init__(self, driver, log):
        self.__log = log
        self.__driver = Element(driver, log)
        self.page = piece_together_element("excessive.yaml")

    def excessive(self):
        self.__driver.swipe_to_top("left", 3)
        self.__driver.click_element(self.page.get("start_btn"), msg="加载过度页面：同意协议按钮")
        self.__driver.check_chckbox(self.page.get("agree_checkbox"), msg="加载过度页面：同意协议勾选框")
        self.__driver.click_element(self.page.get("confirm_start_btn"), "加载过度页面：确认按钮")
        self.__driver.smart_click_element(self.page.get("permissions_but"), key=2, msg="加载过度页面：权限弹窗")
        self.__driver.smart_click_element(self.page.get("next_remind_btn"), msg="加载过度页面：更新弹窗")

